Repository navigation
Close out the v0.4.0 list/show review follow-ups - #7
Merged
Merged
Conversation
familyStates built a letter's family from the effective ladder, and footerLine counted only effective tokens, while clau link is global-only. Under a project [efforts] replacement that warned forever about digit commands link never creates and dropped the global ones it prunes from the denominator (a deleted co5 went unnoticed inside the project). Both now enumerate the global set; project-only tokens stay in the footer count and in clau show.
tokenSource stripped the digit and checked only the project's model letters and profiles, so inside a project whose [efforts] is only 6, clau show o6 said source global. A non-empty project [efforts] replaces the whole ladder, so projectDeclarations now reports it and every digit token counts as project-sourced while it is in effect.
contractHome compared raw strings only, so a home reached through a different symlinked path (or a link dir under one) never contracted. Compare the raw strings first, then both sides through EvalSymlinks; a path that does not exist yet keeps the raw comparison.
usmanbashir
marked this pull request as ready for review
October 27, 2026 15:20
usmanbashir
marked this pull request as draft
October 27, 2026 15:20
usmanbashir
marked this pull request as ready for review
October 27, 2026 15:22
tokenSource applied the digit rules to every token, so a global profile whose name ends in a digit (qwen3, v2) was labeled project-sourced in a project with its own [efforts], and one shaped like a project letter's grammar (g3 under a project declaring g) was already mislabeled on main. Profiles beat the grammar in resolveToken, so a profile the project does not declare is global; check that before the letter and digit rules. tokenSource is now a viewContext method, which is what it reads.
contractHome resolved the whole path, so through an aliased home the linked row of clau show followed the co5 link to the clau binary and printed ~/bin/clau, or the full raw path when the binary sits outside home. Resolve the parent directory only and keep the leaf as named.
familyStates matched letter+digit names against the global token set, which includes profile names, so a profile such as o7 was counted as one of opus's commands and a missing co7 warned on the model row as well as the profile row. A profile wins resolution, so its command is the profile row's alone; skip profile names when building the family. This also stops the older double warning for a profile that shadows a ladder digit, such as o5.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2
All four behavior edges and all eight test-tightening items from the issue, one commit each.
Behavior
clau listlink accounting (row badges and footer) now enumerates the global token set thatclau linkcreates and prunes, instead of the effective ladder filtered by it. Under a project[efforts]replacement the model row no longer warns forever about commands link never creates, and a deleted global command (sayco5) is noticed inside the project too: the footer says 23 of 24 in both places. Project-only digit tokens stay in the footer count and inclau show.clau show <letter><digit>reportssource projectwhenever the project file declares a non-empty[efforts], since that replaces the whole ladder.projectDeclarationsnow reports the flag.contractHomecompares the raw strings first, then both sides throughEvalSymlinks, so a home reached via a different symlinked path still contracts to~. A path that does not exist yet keeps the raw comparison.stdoutIsTTYkeeps the char-device heuristic on purpose; a comment says so rather than adding agolang.org/x/termdependency for an effect nobody can observe.Tests
TestContractHomecoversp == home, and a new symlinked-alias test runs in both directions (skipped on Windows).TestRowBadgescovers all eight combinations, including the orphaned-link ones.TestFamilyStatesexercises a letter without effort digits, asserts orphaned links as linked-but-unlinkable, and covers the project-ladder cases.profilekind row, the pluralKEYS/SECRETS/PASSWORDSand mid-nameTOKEN_EXPIRYenv names, and the exactlinked no — run clau linkhint inTestShowViewProfileare asserted. The issue filed that last one underTestShowViewProjectSourceAndLinked, which already asserts the project-shortcut branch.showsits in each shell's verb list and in its run/show token-completion branch.digitSpannotes its reliance on the single-digit keyseffortKeyReenforces.Manually verified with an isolated
HOME: a digit-6 project with everything linked shows no row badges andall 24 commands linked · 4 project-only; afterrm co5theorow warns and the footer says23 of 24inside the project, with a1/2ladder, and outside it; a project model lettergshowsproject · c gand6 project-only.